﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Templates_ApplicationsHolder_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style>
/*
	root element for the scrollable.
	when scrolling occurs this element stays still.
*/
.applicationsScrollable {
	/* required settings */
	position:relative;
	overflow:hidden;
	width: 960px;
	height:362px;
	cursor:pointer;
}

/*
	root element for scrollable items. Must be absolutely positioned
	and it should have a extremely large width to accommodate scrollable items.
	it's enough that you set width and height for the root element and
	not for this element.
*/
.applicationsScrollable .items {
	/* this cannot be too large */
	width:20000em;
	position:absolute;
}

/*
	a single item. must be floated in horizontal scrolling.
	typically, this element is the one that *you* will style
	the most.
*/
.items div {
	float:left;
	background-repeat:no-repeat;
	background-position:top left;
	width:960px;
	height:362px;
}

</style>

    <script>
// execute your scripts when the DOM is ready. this is mostly a good habit
       $(document).ready(function() {

//        $("ul.flowtabs").tabs(".flowpanes > div");
        //        $("ul.allflowtabs").tabs(".allflowpanes > div.allflowpane");

        //Attach Tabs
        $("ul.flowtabs").tabs(".flowpanes > div");
        $("ul.flowtabs").each(
            function(intIndex) {
                x = $("a" + intIndex);
                x = $(this).data("tabs");
                //console.log(x);
                //alert(x);
                x.onClick(function(index) {
                    initjScrollPane();
                });
            }
        )
        $("ul.allflowtabs").tabs(".allflowpanes > div.allflowpane");
        var apiallflowtabs = $("ul.allflowtabs").data("tabs");
        apiallflowtabs.onClick(function(index) {
            initjScrollPane();
        });
        
        
        var startpos;
        var endpos;
        // initialize scrollable

        $(".applicationsScrollable").scrollable({
            circular: true,
            onSeek: function() {
                $("#navPage li").removeClass("active");
                $("#navPage li").eq(this.getIndex()).addClass("active");
                //alert("load telerik ajax");
                //alert(this.getIndex())
            }
        });

        var api = $(".applicationsScrollable").data("scrollable");

        // use API to add our new item. after the item is being added seek to the end

        $(".applicationsScrollable").mouseup(function(e) {
            endpos = e.pageX;
            if (endpos > startpos) {
                api.prev();
            } else if (endpos < startpos) {
                api.next();
            } else { api.next() }
        })

        $(".applicationsScrollable").mousedown(function(e) {
            endpos = null;
            startpos = e.pageX;
        });

        $("a.lnkNavPage").bind("click", function() {
            pos = $(this).parent().index();
            //$("a.navApplication").removeClass("active");
            //$(this).addClass("active");
            //this.parent
            //alert(pos);
            api.seekTo(pos)
            return false
        });

        initTabScrollable()
        /*$("a.navApplication").each("click", function() {
        alert(this);
        return false
        });*/


        /*$(".applicationsScrollable").click(function() {
        api.next();
        })*/

        //image scrolling
//        var $scrollables = $(".scrollable").scrollable({ vertical: true, mousewheel: true, circular: true});
//        $scrollables.each(function() {
//            var $itemsToClone = $(this).scrollable().getItems().slice(1);
//            var $wrap = $(this).scrollable().getItemWrap();
//            var clonedClass = $(this).scrollable().getConf().clonedClass;
//            $itemsToClone.each(function() {
//                $(this).clone(true).appendTo($wrap)
//			.addClass(clonedClass + ' hacked-' + clonedClass);
//            })
//        })


    });
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="contentTop" Runat="Server">
<div id="top" style="position:relative" class="applicationsHolder">

    <div id="navPageContainer">
        <ul id="navPage" class="allflowtabs clearfix">
                <acms:SimpleRepeater ID="dlPageChildren" DataSourceID="dsChildren" AllowPaging="false" runat="server">
                        <ItemTemplate>
                            <li runat="server" id="navLi" >
                                <asp:HyperLink ID="lnkNavChildren" CssClass="lnkNavPage" NavigateUrl="#" runat="server" />
                            </li>
                        </ItemTemplate>
                    </acms:SimpleRepeater>
                      <acms:PostDataSource ID="dsChildren" runat="server" />
        </ul>
    </div>
    <div class="applicationsScrollable">
        <div class="items">
            <acms:SimpleRepeater ID="dlFeed" DataSourceID="dsChildren" AllowPaging="false" runat="server">
                <ItemTemplate>
                    <asp:Panel ID="pnlItem" runat="server" CssClass="item "/>
                </ItemTemplate>
            </acms:SimpleRepeater>
        
                <%--<asp:Panel ID="ApplicationsCivil" CssClass="item applicationsCivil" runat="server"/>
                <asp:Panel Id="ApplicationsMaritime" class="item applicationsMaritime" runat="server" />
                <asp:Panel Id="ApplicationsMilitary" class="item applicationsMilitary"  runat="server" />--%>
        </div>
        
    </div>
    <%--<a class="prev browse left">---</a><a class="next browse right">|||</a>--%>

    <div id="subNav" style="" class="clearfix">
        <ul id="navApplications" class="">
            
                <acms:SimpleRepeater ID="dlNavParent" DataSourceID="dsParent" AllowPaging="false" runat="server">
                        <ItemTemplate>
                            <li runat="server" id="navLi" class="parent" >
                                <asp:HyperLink ID="lnkNav" CssClass="navApplication" NavigateUrl="#" runat="server" />
                            </li>
                        </ItemTemplate>
                    </acms:SimpleRepeater>
                    
            
                
            
        </ul>
        <ul id="navDetails">
            <acms:SimpleRepeater ID="dlNavSiblings" DataSourceID="dsSibling" AllowPaging="false" runat="server">
                <ItemTemplate>
                    <li runat="server" id="navLi" >
                        <asp:HyperLink ID="lnkNavSibling" CssClass="" NavigateUrl="#" runat="server" />
                    </li>
                </ItemTemplate>
            </acms:SimpleRepeater>
        
        <acms:PostDataSource ID="dsParent" runat="server" />
            <acms:PostDataSource ID="dsSibling" runat="server" />
                <%--<li><acms:PostLink ID="PostLink2" Path="~/Press-Area/Videos" runat="server" Text="Videos" /></li>--%>
                <%--<li><acms:PostLink ID="PostLink3" Path="~/Contact/Support" runat="server" Text="Support" /></li>--%>
                <li><acms:PostLink ID="PostLink1" Path="~/Download/Brochures" runat="server" Text="Brochures" /></li>
        </ul>
        
    </div>
    <div id="pageTitle" class="clearfix">
            <h1><acms:PostDisplayName ID="PostDisplayName" runat="server" /></h1>
            <asp:HyperLink NavigateUrl="#" id="lnkMoreInfo" runat="server" href="#" class="moreInfo moreInfoOpen off" Text="More Info"/>
        </div>
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentBase" Runat="Server">

    <div id="base" class="clearfix">
        <div class="allflowpanes clearfix">
    
            <acms:SimpleRepeater ID="rptTabs" DataSourceID="dsTabs" runat="server">
                <ItemTemplate>
                    <acms:SubTemplateLoader ID="tabs" TemplateFileName="Display" runat="server" />
                </ItemTemplate>
            </acms:SimpleRepeater>
            <acms:PostDataSource ID="dsTabs" runat="server" />
            <a href="#" class="moreInfo moreInfoClose open">Close</a>
        </div>
    </div>

</asp:Content>